Repository navigation
fix: deprecate bubbling of direct events in fireEvent - #1941
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1941 +/- ##
==========================================
+ Coverage 98.36% 98.56% +0.20%
==========================================
Files 87 87
Lines 1714 1744 +30
Branches 449 481 +32
==========================================
+ Hits 1686 1719 +33
+ Misses 26 24 -2
+ Partials 2 1 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
^ Conflicts: ^ src/events/propagation.ts
mdjastrzebski
force-pushed
the
fix/non-bubbling-events
branch
from
October 7, 2026 13:23
cad6c61 to
28015f0
Compare
fireEvent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
React Native delivers direct events (e.g.
ScrollViewscroll,Imageload,layout) only to the emitting element, butfireEventbubbles them. This PR deprecates that:fireEventwarns when a direct event bubbles to an ancestor that emits it. Bubbling stops in the next major.isDirectEvent()). Composite handlers count as being on the composite's root host element.fireEvent.layout()shows the intended behavior (no bubbling).fireEvent(element, 'layout')now bubbles with the warning, for compatibility.Also fixes
undefinedfields infireEvent.layout()and renames the internalEventNametype toEventType.Test plan